export default {
  facets: [{
    code: 'node',
    name: '节点配置',
    model: {
      path: '/service/{app}/list?a=l1',
      events: [{
        condition: '${code}!=""',
        'hiddens': [
          'memo'
        ]
      }, {
        condition: '${facets.name}==1',
        'hiddens': [
          'type'
        ]
      }],
      col_count: 1,
      bill_code: 'node',
      code: 'node',
      // ======================ACTION==============================//
      actions: [
        {
          'path': 'service/{app}/case/allot2collector',
          'locate': 'right',
          'type': 'process',
          'scope': 'optional',
          'name': '分配1',
          'param': {
            'form_display': 'auto',
            'fields': [
              {
                'code': 'rule_id',
                'name': '规则',
                'type': 'ref',
                'rangeset': 'ds_db_rule_allot'
              }
            ]
          }
        }, {
          'type': 'add',
          'name': '新增',
          'locate': 'right',
          'serial': 1,
          param: {
            path_eval: '/service/app/eval',
            bil_code: 'organization',
            eval_require: true,
            eval_name: '预算'
          }
        }],
      actions2: [{
        'type': 'add',
        'name': '新增',
        'serial': 1,
        'locate': 'right',
        param: {
          // select_rangeset: '{"path":"/service/{app}/bb"}',
          // bill_code: '${code}'
          path_model: 'service/error/{id}/{code}'
        }
      }, {
        'locate': 'inline',
        'name': '执行检查',
        'path': 'service/{app}/monitor/{code}',
        'scope': 'default',
        'param': {
          'fields': [{
            'cardpos': 2,
            'code': 'check_start_time',
            'listpos': 2,
            'name': '巡检开始时间',
            'scope': 'both',
            'required': false,
            'def_value': 0,
            'status': 5,
            'type': 'date'
          }]
        },
        'type': 'process'
      }, {
        type: 'edit',
        name: 'edit test',
        param: {
          path_model: 'service/error/{id}/{code}'
        }
      }, {
        'type': 'drill',
        'name': '钻取',
        'serial': 1,
        param: {
          bill_code: 'performance_detail_edit',
          list_filter: true,
          filter_mapping: {
            memo: 'memo',
            pp: 'pp',
            'allot_status': 'allot_status'
          }
        }
      }, {
        'type': 'view',
        'name': 'v',
        'serial': 1,
        'locate': 'auto'
      }, {
        'type': 'process',
        'name': 'process',
        'serial': 1,
        'path': 'xx'
      },

        {
          'type': 'process',
          'path': 'service/{app}/case/allot/out/score/cal',
          'code': 'allot_out_all_score',
          'name': '计算外包案件评分',
          'locate': 'left',
          'param': {
            'fields': [{
              'cardpos': 2,
              'code': 'is_force',
              'listpos': 2,
              'name': '是否强制覆盖',
              'rangeset': '1:是@0:否',
              'scope': 'both',
              'required': true,
              'def_value': 0,
              'param_def_value': 0,
              'status': 5,
              'type': 'stat'
            }, {
              cardpos: 1,
              code: 'a1',
              name: 'a1',
              dedault: 1,
              editable: false
            }]
          }
        },
        {
          'type': 'process',
          'code': 'recycle_to_collect_tenantry',
          'name': '回收至催收方',
          'locate': 'right',
          'path': '/service/cs/list?a=p1',
          'param': {
            // 'select_data': 'true:是@false:否',
            // 'select_param_key': 'enable_force',
            // 'select_name': '强制回收催收未到期案件',
            form_display: 'plain',
            'fields': [{
              'cardpos': 2,
              'def_value': '1',
              'code': 'status',
              'editable': false,
              'type': 'stat',
              'listpos': 2,
              'required': true,
              'crt_ts': 1513569390746,
              'rangeset': '1:编辑@3:发布',
              'scope': 'both',
              'name': '状态',
              'lm_ts': 1513569390746,
              'tip': '提示信息',
              'status': 5
            }]

          },
          'scope': 'optional',
          'serial': 1
        },
        {
          'type': 'edit',
          'name': '修改hah1a',
          'serial': 2
        },
        {
          'type': 'delete',
          'name': '删除',
          'locate': 'none',
          'serial': 2
        },
        {
          'type': 'case_detail',
          'name': '查看',
          'locate': 'none',
          'param': {
            'trigger': 'dbclick'
          },
          'serial': 3
        }
      ],
      // ================== field ================================================================
      fieldset: [{
        code: 'a1',
        name: '1',
        collapse: false
      }],
      fields: [{
        'cardpos': 0,
        'code': 'allot_status',
        'editable': false,
        'listpos': 0,
        'name': '分类',
        'def_value': 0,
        'param_def_value': 0,
        'param': {},
        'rangeset': '',
        'scope': 'data',
        'status': 5,
        'type': 'integer'
      }, {
        code: 'code',
        type: 'code',
        name: '编码',
        required: true,
        fieldset: 'a1',
        def_value: '110',
        scope: 'data',
        'param': {
          'mapping': 'xxx={t2}',
          enable_copy: true
        },
        rangeset: {
          'code': 'ds_collector',
          'key': 'code',
          'path': 'service/dw/list',
          'tpl_res': '${collector_name}(${collector_code})',
          'tpl_list': '!${code}!',
          'mapping': {
            't1': 'name',
            't2': 'code'
          }
        },
        status: 0,
        tip: '800'
      }, {
        code: 'ts',
        type: 'date',
        name: 'time',
        fieldset: 'a1',
        param_def_value: 'now()',
        param: {
          range: true
        },
        scope: 'param'
      }, {
        'cardpos': 3,
        'code': 'contract_code1',
        'listpos': 3,
        'name': '合同编号1',
        'param': {},
        'rangeset': {
          'code': 'db_cs_case',
          'key': 'contract_code',
          'tpl_res': '${contract_code}(${collector_name}:M${overdue_period})',
          'tpl_list': '${contract_code}(${collector_name}:M${overdue_period})',
          'mapping': {
            'case_id': 'case_id',
            'enable_close': 'closed_status',
            'total_balance': 'total_balance',
            'overdue_period': 'overdue_period',
            'contract_code': 'contract_code',
            'product_type': 'product_type',
            'collector_id': 'collector_id',
            'collector_name': 'collector_name',
            'org_name': 'org_name',
            'org_id': 'org_id'
          }
        },
        'tpl': '${contract_code}',
        'scope': 'data',
        'status': 5,
        'type': 'code'
      }, {
        'cardpos': 3,
        'code': 'contract_code',
        'listpos': 3,
        'name': '合同编号',
        'param': {},
        'rangeset': {
          'code': 'db_cs_case',
          'key': 'contract_code',
          'tpl_res': '${contract_code}',
          'tpl_list': '${contract_code}',
          'mapping': {
            'case_id': 'case_id',
            'enable_close': 'closed_status',
            'total_balance': 'total_balance',
            'overdue_period': 'overdue_period',
            'contract_code': 'contract_code',
            'product_type': 'product_type',
            'collector_id': 'collector_id',
            'collector_name': 'collector_name',
            'org_name': 'org_name',
            'org_id': 'org_id'
          }
        },
        'tpl': '${contract_code}',
        'scope': 'data',
        'status': 5,
        'type': 'code'
      }, {
        'cardpos': 34,
        'code': 'collector_id',
        'listpos': 28,
        'name': '催收人员',
        'status': 5,
        'param': {
          mapping: 'A=${type}%%%%%%%'
        },
        'rangeset': {
          'code': 'db_account'
        },
        'tpl': '${collector_name}',
        'scope': 'both',
        'type': 'ref'
      }, {
        code: 't1',
        fieldset: 'a1',
        name: 't1',
        tpl: '<Audio_player></Audio_player>'
      }, {
        code: 't2',
        fieldset: 'a1',
        name: 't2'
      }, {
        'cardpos': 28,
        'code': 'org_id',
        'editable': false,
        'type': 'ref',
        'listpos': 34,
        'required': true,
        'tpl': '${org_name}',
        'crt_ts': 1512699528388,
        'param': {
          'mapping': 'id={org_id}'
        },
        'rangeset': '{"tpl_res":"${name}","mapping":{"collector_name":"name"},"code":"db_account","tpl_list":"${name}"}',
        'scope': 'both',
        'name': '组织',
        'lm_ts': 1512699528388,
        'tip': '提示信息',
        'status': 5
      }, {
        'cardpos': 1,
        'code': 'asset_tenantry_id',
        'editable': true,
        'type': 'ref',
        'listpos': 1,
        'crt_ts': 1512699528387,
        'param': {
          'mapping': 'xxx={id}'
        },
        'rangeset': '{"mapping":{"code":"code"},"code":"ds_asset_tenantry"}',
        'scope': 'both',
        'name': '案件来源',
        'lm_ts': 1512699528387,
        'tip': '提示信息',
        'status': 5
      }, {
        code: 'test1',
        name: '1111111111111',
        scope: 'data',
        param_def_value: '432432'
      }, {
        code: 'name',
        type: 'integer',
        tpl: '${id}(${code})',
        rangeset: {
          code: 'db_actuator',
          mapping: {
            code: 'id'
          }
        },
        param: {
          range: true
        },
        fieldset: 'a2',
        name: '名称111',
        tip: '890000'
      }, {
        code: 'enable_publish',
        name: '已发布',
        type: 'code',
        default_value: '11',
        editable: true
      }, {
        code: 'memo',
        type: 'memo',
        required: false,
        name: '备注',
        tpl: '<Audio_player src="/static/Preparation.mp3" length="10"></Audio_player>'
      }, {
        code: 'type',
        name: '类型',
        fieldset: 'a3',
        type: 'state',
        rangeset: '3:31@1:1@2:2',
        param_def_value: null,
        param: {
          range: true
        }
      }],
      actions1: [{
        type: 'apply_confirm',
        param: {
          list_bill_code: 'apply_confirm',
          form_bill_code: 'apply_confirm'
        }
      }, {
        type: 'dev',
        name: '测试用'
      }, {
        type: 'drill',
        dev: true,
        locate: 'hidden',
        param: {
          bill_code: 'entity',
          list_filter: true,
          filter_mapping: {
            code: 'code',
            test1: 'test1'
          }
        }
      }, {
        type: 'webcall',
        dev: true,
        param: {
          // field_phone: 'name',
          path_phone: 'service/{app}/call',
          on_loss: 'drill',
          on_get: 'edit'
        },
        locate: 'inline',
        name: '联系债权人'
      }, {
        type: 'add',
        dev: true,
        icon: 'plus',
        scope: 'data',
        param: {
          /*bill_code: 'collect_log'*/
        }
      }, {
        type: 'edit',
        dev: true,
        param: {
          path_find: '/service/t2?id={id}',
          trigger: 'dbclick'
        }
      }, {
        code: 'add',
        type: 'add',
        icon: 'plus',
        name: '新增节点',
        param: {
          path_data: '/service/t1',
          path_submit: '/service/{app}/nf/model',
          size: 'l',
          col: 2
        }
      }, {
        type: 'case_detail',
        name: '详情',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/nf/model/{code}',
          path_submit: '/service/{app}/nf/model',
          size: 'l',
          col: 2
        }
      }, {
        code: 'nodeView',
        type: 'nodeView',
        name: '预览',
        locate: 'inline',
        param: {
          path_find: '/service/{app}/nf/model/{code}'
        }
      }, {
        code: 'delete',
        type: 'delete',
        path: '/service/{app}/nf/model',
        scope: 'rows',
        name: '删除'
      }, {
        code: 'nodePublish',
        type: 'nodePublish',
        locate: 'inline',
        icon: 'forward',
        name: '生成节点',
        path: 'service/{app}/nf/model/exp',
        param: {
          condition: '!data.enable_publish'
        }
      }, {
        code: 'recall',
        type: 'process',
        locate: 'inline',
        icon: 'reply',
        name: '撤回节点',
        path: 'service/{app}/nf/model/recall/{id}',
        param: {
          condition: 'data.enable_publish'
        }
      },
        {
          code: 'publish',
          type: 'process',
          path: 'service/{app}/nf/model/pubilsh',
          scope: 'rows',
          name: '发布'
        },
        {
          code: 'seal',
          type: 'process',
          path: 'pf/nf/model/seal',
          scope: 'rows',
          name: '停用'
        }, {
          type: 'list_editor',
          name: '编辑参数',
          param: {
            path_model: 'service/{app}/testModel',
            path_data: 'service/dw/nf/models'

          }
        }
      ],
      slaves: [{
        code: 'facets',
        enable_attachment: 0,
        name: '节点内容',
        fields: [{
          code: 'ref',
          name: 'ref',
          type: 'ref',
          rangeset: 'db_account',
          param: {
            mapping: 'a=1;b=2;c=${name};d=${parent.name}'
          }
        }, {
          code: 'name',
          name: '名称',
          type: 'code',
          rangeset: {
            min: '${parent.code}'
          },
          status: 0
        }, {
          code: 'type',
          name: '类型',
          type: 'code'
        }, {
          code: 'bill_code',
          name: '单据',
          type: 'ref',
          rangeset: {
            path: '/service/{app}/bill/models?disable_db=false',
            key: 'code'
          }
        }],
        actions: [{
          code: 'add',
          type: 'add',
          name: '添加单据1',
          param: {
            local: true,
            size: 'm'
          }
        }, {
          code: 'pr',
          type: 'process',
          name: 'p',
          path: '${parent.code}'
        },
          /*{
                   code: 'delete',
                   type: 'delete',
                   locate: 'box',
                   path: '/x'
                 }, {
                   code: 'upload',
                   param: {
                     module: 'upload'
                   }
                 }, {
                   code: 'view',
                   type: 'view',
                   name: 'view',
                   param: {

                   }
                 },
                  */
          {
            code: 'edit',
            type: 'edit',
            name: '编辑',
            locate: 'box',
            scope: 'data',
            param: {
              local: true,
              size: 'm'
            }
          }
        ]
      }]
    }
  },
    {
      code: 'bill',
      name: '单据配置',
      model: {
        path: '/service/{app}/list?a=l2',
        fields: [{
          code: 'code',
          type: 'code',
          name: '编码'
        }, {
          code: 'name',
          type: 'code',
          name: '名称'
        }, {
          code: 'memo',
          type: 'memo',
          name: '备注'
        }, {
          code: 'status',
          type: 'state',
          name: '状态',
          cardpos: 0
        }],
        slaves: [{
          code: 'structs',
          name: '实体结构',
          fields: [{
            code: 'code',
            name: '编码',
            type: 'code'
          }, {
            code: 'name',
            name: '名称',
            type: 'code'
          }, {
            code: 'type',
            name: '类型',
            type: 'code'
          }, {
            code: 'enable_main',
            name: '主表',
            type: 'bool'
          }, {
            code: 'ref_type',
            type: 'state',
            name: '子表关系',
            rangeset: 'direct:direct@bridge:bridge@weak:weak'
          }, {
            code: 'memo',
            name: '备注',
            type: 'memo'
          }],
          actions: [{
            code: 'add',
            type: 'add',
            name: '添加表结构',
            param: {
              local: true,
              col: 2,
              size: 'max'
            }
          }, {
            code: 'delete',
            type: 'delete',
            path: '/delete'
          }, {
            code: 'addEntity',
            type: 'billAddEnitty',
            name: '添加实体',
            param: {
              local: true,
              col: 2,
              size: 'max'
            }
          },
            {
              code: 'setRm',
              type: 'setRm',
              name: '关联关系',
              locate: 'inline',
              param: {
                condition: '${!data.enable_main}'
              }
            },
            {
              code: 'edit',
              type: 'edit',
              name: '编辑',
              locate: 'inline',
              param: {
                local: true,
                col: 2,
                size: 'max'
              }
            }
          ],
          slaves: [{
            code: 'fields',
            type: 'editor',
            name: '实体字段',
            fields: [{
              name: '编码',
              code: 'code',
              type: 'code'
            }, {
              name: '名称',
              code: 'name',
              type: 'code'
            }, {
              name: '类型',
              code: 'type',
              type: 'code',
              rangeset: ['pk', 'code', 'date', 'timestamp', 'memo', 'money', 'seriescode', 'stat', 'clob', 'integer', 'ref', 'json']
            }, {
              name: '作用范围',
              code: 'scope',
              type: 'state',
              rangeset: 'data:数据@param:参数@both:全部'
            }, {
              name: '取值范围',
              code: 'rangeset',
              type: 'code'
            }, {
              name: '默认值',
              code: 'def_value',
              type: 'code'
            }, {
              name: '列表序号',
              code: 'listpos',
              type: 'integer'
            }, {
              name: '表单序号',
              code: 'cardpos',
              type: 'integer'
            }, {
              name: '备注',
              code: 'memo',
              type: 'memo'
            }, {
              name: '可编辑',
              code: 'editable',
              type: 'bool'
            }, {
              name: '必填',
              code: 'required',
              type: 'bool'
            }]
          }]
        }],
        actions: [{
          code: 'add',
          type: 'add',
          icon: 'android-list',
          name: '添加列表单据',
          param: {
            path_submit: '/service/{app}/bill/model',
            size: 'l'
          }
        }, {
          'type': 'process',
          'code': 'recycle_to_collect_tenantry',
          'name': '回收至催收方1',
          'locate': 'right',
          'path': '/service/cs/list?a=p1',
          'param': {
            'select_data': 'true:是@false:否',
            'select_param_key': 'enable_force',
            'select_name': '强制回收催收未到期案件'
          },
          'scope': 'optional',
          'serial': 1
        }, {
          code: 'billView',
          type: 'billView',
          name: '预览',
          locate: 'inline',
          param: {
            path_find: '/service/{app}/bill/model/{code}',
            size: 'l',
            col: 2
          }
        }, {
          code: 'outputJson',
          type: 'outputJson',
          name: '导出',
          locate: 'inline',
          param: {
            path_find: '/service/{app}/bill/model/{code}',
            path_submit: '/service/{app}/bill/model',
            size: 'l',
            col: 2
          }
        }, {
          code: 'edit',
          type: 'edit',
          name: '编辑',
          locate: 'inline',
          param: {
            path_find: '/service/{app}/bill/model/{code}',
            path_submit: '/service/{app}/bill/model',
            size: 'l',
            col: 2
          }
        }, {
          code: 'delete',
          type: 'delete',
          path: '/service/{app}/bill/model',
          scope: 'rows',
          name: '删除'
        }]
      }
    }
  /*,{
     code: 'rm',
     name: '资源映射模型',
     model: {
       code: 'resource_mapping',
       path: '/service/{app}/dataset/data/db_resourcemapping',
       // bill_code: 'resource_mapping',
       name: '资源映射',
       fields: [{
         code: 'code',
         name: '编码',
         type: 'code',
         cardpos: 1
       }, {
         code: 'name',
         name: '名称',
         type: 'code',
         cardpos: 2
       }, {
         code: 'relation_code',
         name: '映射储存表',
         type: 'code',
         cardpos: 9
       }, {
         code: 'cacheable',
         name: '启用缓存',
         type: 'state',
         rangeset: '0:是@3:否',
         cardpos: 3
       }, {
         code: 'sortable',
         name: '可排序',
         type: 'stat',
         rangeset: '0:是@3:否',
         cardpos: 4
       }, {
         code: 'subject_id',
         name: '主体数据集',
         type: 'ref',
         cardpos: 5,
         rangeset: {
           path: '/service/{app}/bill/data/dataset/list'
         }
       }, {
         code: 'subject_tpl',
         name: '主体模板',
         type: 'code',
         cardpos: 6
       }, {
         code: 'resource_id',
         name: '资源数据集',
         type: 'ref',
         cardpos: 7,
         rangeset: {
           path: '/service/{app}/bill/data/dataset/list'
         }
       }, {
         code: 'resource_tpl',
         name: '资源模板',
         type: 'code',
         cardpos: 8
       }, {
         code: 'memo',
         name: '备注',
         type: 'memo',
         cardpos: 10
       }],
       actions: [{
         code: 'add',
         type: 'add',
         icon: 'android-list',
         name: '添加',
         param: {
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'billView',
         type: 'billView',
         name: '预览',
         locate: 'inline',
         param: {
           path_find: '/service/{app}/bill/model/{code}',
           size: 'l',
           col: 2
         }
       }, {
         code: 'outputJson',
         type: 'outputJson',
         name: '导出',
         locate: 'inline',
         param: {
           path_find: '/service/{app}/bill/model/{code}',
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'edit',
         type: 'edit',
         name: '编辑',
         locate: 'inline',
         param: {
           model: 'bill',
           path_find: '/service/{app}/bill/model/{code}',
           path_submit: '/service/{app}/bill/model',
           size: 'l',
           col: 2
         }
       }, {
         code: 'delete',
         type: 'delete',
         path: '/service/{app}/bill/model',
         scope: 'rows',
         name: '删除'
       }]
     }
   }*/
  ]
}
